var 品客缤图标 = "#fUI/UIWindow2.img/StagedGachapon/Creature/0/normal/2#";
var 心形图标 = "#fUI/UIWindow2.img/Megaphone/0#";
var one = "#fUI/UIPVP.img/UserRanking/NumRank/Survival/1#";
var two = "#fUI/UIPVP.img/UserRanking/NumRank/Survival/2#";
var three = "#fUI/UIPVP.img/UserRanking/NumRank/Survival/3#";
var 造型卡 = 5152053;
var 美容列表 = [];
var 定制美容价格 = 15000;
var 随机美容价格 = 6000;
var 定制美容价格 = 15000;
var 随机美容价格 = 6000;
var 皮肤染色 = [0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 16];
var status = -1;
var selectionLog = [];

function start() {
    action(1, 0, 0)
}

function action(e, f, h) {
    if (cm.getzhizunvip() == 2) {
        男美容列表 = 至尊男美容;
        女美容列表 = 至尊女美容
    } else {
        男美容列表 = 黄金男美容;
        女美容列表 = 黄金女美容
    }
    var d = 男美容列表[Math.floor(Math.random() * 男美容列表.length)];
    var b = 女美容列表[Math.floor(Math.random() * 女美容列表.length)];
    var a = cm.getPlayer().getFace();
    var j = cm.getPlayer().getSecondFace();
    var g = 2;
    if (status == 0 && e == 0) {
        cm.dispose();
        return
    }(e == 1) ? status++ : status--;
    selectionLog[status] = h;
    var c = -1;
    if (status <= c++) {
        cm.dispose()
    } else {
        if (status === c++) {
            if (cm.getPlayer().getCSPoints(1) >= 随机美容价格) {
                cm.getPlayer().modifyCSPoints(1, -随机美容价格, true);
                cm.getTopMsgFont("随机美容成功", 3, 20, 20, 0);
                cm.addTrait("魅力", 50);
                cm.forceStartQuest(10000086);
                cm.forceCompleteQuest(10000086);
                cm.set神之子通用脸型(d, b);
                cm.神之子更换完发型脸型对比UI(造型卡, g, j, b, a, d);
                cm.removeItem(造型卡);
                cm.dispose()
            } else {
                cm.playerMessage(-1, "好像没有钱？等有钱了再来吧！");
                cm.dispose()
            }
        }
    }
}
var 黄金男美容 = [25194, 23022, 26360, 23080, 25629, 20043, 20067, 25000, 23030, 20152, 23176, 20044, 20035, 23116, 20033, 23128, 23183, 20046, 25019, 25121, 20061, 20011];
var 黄金女美容 = [28728, 27625, 27414, 27413, 25795, 26495, 26494, 25797, 25796, 26686, 25771, 24896, 26360, 24078, 21112, 21042, 24002, 24127, 21194, 24027, 21082, 21236, 24010, 24188, 26227, 25617, 24139, 25403, 24122, 24036, 21025, 26234, 25104, 24235, 21149, 21062, 26142, 24631, 24732, 21250, 24058, 21070, 26012, 21144, 21079, 26125, 24198, 21028, 21031, 21033, 24171, 25778];
var 至尊男美容 = [23081, 23082, 23083, 23084, 23086, 23088, 23089, 23090, 23092, 23097, 23098, 20071, 20141, 23029, 23031, 23032, 23034, 23043, 23053, 23054, 23059, 23061, 23064, 23066, 23068, 23071, 23072, 23076, 25061, 25074, 25817, 25821, 23012, 23014, 23019, 23020, 23024, 23028, 20811, 25000, 25006, 25012, 25016, 25019, 25022, 25023, 25024, 25025, 25029, 25031, 25043, 25049, 25051, 25057, 20535, 20543, 20546, 20549, 20481, 20486, 20509, 20520, 20521, 20526];
var 至尊女美容 = [21001, 21028, 21031, 21033, 21041, 21042, 24650, 24652, 28753, 24671, 24598, 24601, 24608, 24612, 24620, 24622, 24624, 24626, 26003, 26005, 26007, 26015, 26019, 26020, 26023, 26025, 26026, 26030, 26031, 26046, 26059, 26065, 26827, 21044, 21055, 21064, 21070, 21079, 21081, 21083, 21093, 21094, 21097, 21140, 25044, 25045];

function randomNum(b, a) {
    switch (arguments.length) {
        case 1:
            return parseInt(Math.random() * b + 1, 10);
            break;
        case 2:
            return parseInt(Math.random() * (a - b + 1) + b, 10);
            break;
        default:
            return 0;
            break
    }
};